package com.hl.hospital.controller;

import com.hl.hospital.config.Constants;
import com.hl.hospital.dao.ViYfDjMapper;
import com.hl.hospital.dao.ViYfDjmxMapper;
import com.hl.hospital.dao.ViYfFyMapper;
import com.hl.hospital.dao.ViYfPdMapper;
import com.hl.hospital.entity.ViYfDj;
import com.hl.hospital.entity.ViYfDjmx;
import com.hl.hospital.dao.ViYfPdmxMapper;
import com.hl.hospital.entity.ViYfFy;
import com.hl.hospital.entity.ViYfPd;
import com.hl.hospital.entity.ViYfPdmx;
import com.hl.hospital.dao.*;
import com.hl.hospital.entity.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 *
 * @Auther: hl
 * @Date: 2021/06/23/10:34
 */
@Controller
public class VIYFController {
    @Autowired
    private ViYfFyMapper viYfFyMapper;
    @Autowired
    private ViYfDjMapper viYfDjMapper;
    @Autowired
    private ViYfDjmxMapper viYfDjmxMapper;
    @Autowired
    private ViYfKcmxMapper viYfKcmxMapper;
    @Autowired
    private ViYfKcmxMzMapper viYfKcmxMzMapper;
    @Autowired
    private ViYfKcphMapper viYfKcphMapper;
    @Autowired
    private ViYfFymxMapper viYfFymxMapper;
    //Dwhere
    @Autowired
    private ViYfPdMapper viYfPdMapper;
    @Autowired
    private ViYfPdmxMapper viYfPdMxMapper;
    @Autowired
    private ViYfPdmxKcmxMapper viYfPdmxKcmxMapper;
    @Autowired
    private ViYfTldMapper viYfTldMapper;
    @Autowired
    private ViYfTldmxMapper viYfTldmxMapper;
    @Autowired
    private ViYfXyfKcmxMapper viYfXyfKcmxMapper;
    @Autowired
    private ViYfXyfKcphMapper viYfXyfKcphMapper;

    @RequestMapping("viyfpd")
    public String viyfpd(Model model)
    {
        List<ViYfPd> viYfPds = viYfPdMapper.selectAll();
        model.addAttribute(Constants.VIYFPD,viYfPds);
        return "viyfpd";
    }

    @RequestMapping("viyffy")
    public String viyffy(Model model)
    {
        List<ViYfFy> viyffies = viYfFyMapper.selectAll();
        model.addAttribute(Constants.VIYFFY,viyffies);
        return "viyffy";
    }
    @RequestMapping("viyfpdmx")
    public String viyfpdmx(Model model)
    {
        List<ViYfPdmx> viYfPdmxs = viYfPdMxMapper.selectAll();
        model.addAttribute(Constants.VIYFPDMX,viYfPdmxs);
        return "viyfpdmx";
    }

    /**
     * @author xsl
     * dbo.VI_YF_DJ
     * dbo.VI_YF_DJMX
     * @param model
     * @return
     */
    @RequestMapping("viyfdj")
    public String viyfdj(Model model){
        List<ViYfDj> viYfDjs = viYfDjMapper.selectAll();
        model.addAttribute(Constants.VIYFDJ,viYfDjs);
        return "viyfdj";
    }
    @RequestMapping("viyfdjmx")
    public String viyfdjmx(Model model){
        List<ViYfDjmx> viYfDjmxes = viYfDjmxMapper.selectAll();
        model.addAttribute(Constants.VIYFDJMY,viYfDjmxes);
        return "viyfdjmx";
    }

    @RequestMapping("viyfpdmxkcmx")
    public String viyfpdmxkcmx(Model model) {
        List<ViYfPdmxKcmx> viYfPdmxsKcmxs = viYfPdmxKcmxMapper.selectAll();
        model.addAttribute(Constants.VIYFPDMXKCMX, viYfPdmxsKcmxs);
        return "viyfpdmxkcmx";
    }

    @RequestMapping("viyffymx")
    public String viyffymx(Model model) {
        List<ViYfFymx> viYfFymxes = viYfFymxMapper.selectAll();
        model.addAttribute(Constants.VIYFFYMX, viYfFymxes);
        return "viyffymx";
    }

    @RequestMapping("viyfkcmx")
    public String viyfkcmx(Model model) {
        List<ViYfKcmx> viYfKcmxes = viYfKcmxMapper.selectAll();
        model.addAttribute(Constants.VIYFKCMX, viYfKcmxes);
        return "viyfkcmx";
    }

    @RequestMapping("viyftld")
    public String viyftld(Model model) {
        List<ViYfTld> viYfTlds = viYfTldMapper.selectAll();
        model.addAttribute(Constants.VIYFTLD, viYfTlds);
        return "viyftld";
    }

    @RequestMapping("viyfkcmxmz")
    public String viyfkcmxmz(Model model) {
        List<ViYfKcmxMz> viYfKcmxMzs = viYfKcmxMzMapper.selectAll();
        model.addAttribute(Constants.VIYFKCMXMZ, viYfKcmxMzs);
        return "viyfkcmxmz";
    }

    @RequestMapping("viyftldmx")
    public String viyftldmx(Model model) {
        List<ViYfTldmx> viYfTldmxes = viYfTldmxMapper.selectAll();
        model.addAttribute(Constants.VIYFTLDMX, viYfTldmxes);
        return "viyftldmx";
    }

    @RequestMapping("viyfkcph")
    public String viyfkcph(Model model) {
        List<ViYfKcph> viYfKcphs = viYfKcphMapper.selectAll();
        model.addAttribute(Constants.VIYFKCPH, viYfKcphs);
        return "viyfkcph";
    }

    //Dwhere
    @RequestMapping("viyfxyfkcmx")
    public String viyfxyfkcmx(Model model) {
        List<ViYfXyfKcmx> viYfXyfKcmxes = viYfXyfKcmxMapper.selectAll();
        model.addAttribute(Constants.VIYFXYFKCMX, viYfXyfKcmxes);
        return "viyfxyfkcmx";
    }
    @RequestMapping("viyfxyfkcph")
    public String viyfxyfkcph(Model model) {
        List<ViYfXyfKcph> viYfXyfKcphs = viYfXyfKcphMapper.selectAll();
        model.addAttribute(Constants.VIYFXYfKCPH, viYfXyfKcphs);
        return "viyfxyfkcph";
    }
}
